<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>

	</head>
	<body>
		<button type="button">操作元素行内样式</button>
		<div style="width: 100px;height: 100px;background-color: aqua;">
			文本内容
		</div>
	</body>
	<script type="text/javascript" charset="utf-8">
			
			//获取元素
			var box=document.querySelector('div')
			var btn=document.querySelector('button')
			
			//获取样式
			console.log(box.style.backgroundColor)//有-连接的要改为驼峰命名法
			
			//设置样式
			btn.onclick=function(){
				box.style.width="300px"
				box.style.height="400px"
				box.style.backgroundColor='#1E90FF'
			}
	</script>
</html>
